package com.ujiuye.converter;

import org.springframework.core.convert.converter.Converter;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateConverter implements Converter<String,Date> {
    @Override
    public Date convert(String arg0) {

        SimpleDateFormat sdf = null;
        Date date  = null;
        try {
            sdf = new SimpleDateFormat("yyyy-MM-dd");
            date = sdf.parse(arg0);
        }catch(Exception e) {
            e.printStackTrace();
        }
        return date;
    }
}
